package com.examples;

import toman.Index;
import toman.Ref;
import toman.orm.TO;

import java.util.Date;

@TO(
    id = "a.name=:name",
    read = "select a.name, a.created from Album a",
    write = "update Album a set a.name=:name")
public class SimpleAlbumTO {

    @Index(0)
    private String name;

    @Index(1)
    private Date created;

    @Ref
    private UserTO user;

    public String getName() {
        return name;
    }

    public void setName(String albumName) {
        this.name = albumName;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public UserTO getUser() {
        return user;
    }
}
